import request from '@/axios';

export const getList = (current, size, params) => request({
  url: '/zzy-system/region/list',
  method: 'get',
  params: {
    ...params,
    current,
    size,
  },
});

export const getLazyTree = (parentCode, params) => request({
  url: '/zzy-system/region/lazy-tree',
  method: 'get',
  params: {
    ...params,
    parentCode,
  },
});

export const getDetail = code => request({
  url: '/zzy-system/region/detail',
  method: 'get',
  params: {
    code,
  },
});

export const remove = id => request({
  url: '/zzy-system/region/remove',
  method: 'post',
  params: {
    id,
  },
});

export const submit = row => request({
  url: '/zzy-system/region/submit',
  method: 'post',
  data: row,
});
